package com.srwl.mytx.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.srwl.mytx.domain.Contact;
import com.srwl.mytx.domain.ConversationData;
import com.srwl.mytx.domain.InfiniteConnect;
import com.srwl.mytx.domain.Message;
import com.srwl.mytx.domain.Notify;
import com.srwl.mytx.domain.User;

import com.srwl.mytx.greendao.ContactDao;
import com.srwl.mytx.greendao.ConversationDataDao;
import com.srwl.mytx.greendao.InfiniteConnectDao;
import com.srwl.mytx.greendao.MessageDao;
import com.srwl.mytx.greendao.NotifyDao;
import com.srwl.mytx.greendao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig contactDaoConfig;
    private final DaoConfig conversationDataDaoConfig;
    private final DaoConfig infiniteConnectDaoConfig;
    private final DaoConfig messageDaoConfig;
    private final DaoConfig notifyDaoConfig;
    private final DaoConfig userDaoConfig;

    private final ContactDao contactDao;
    private final ConversationDataDao conversationDataDao;
    private final InfiniteConnectDao infiniteConnectDao;
    private final MessageDao messageDao;
    private final NotifyDao notifyDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        contactDaoConfig = daoConfigMap.get(ContactDao.class).clone();
        contactDaoConfig.initIdentityScope(type);

        conversationDataDaoConfig = daoConfigMap.get(ConversationDataDao.class).clone();
        conversationDataDaoConfig.initIdentityScope(type);

        infiniteConnectDaoConfig = daoConfigMap.get(InfiniteConnectDao.class).clone();
        infiniteConnectDaoConfig.initIdentityScope(type);

        messageDaoConfig = daoConfigMap.get(MessageDao.class).clone();
        messageDaoConfig.initIdentityScope(type);

        notifyDaoConfig = daoConfigMap.get(NotifyDao.class).clone();
        notifyDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        contactDao = new ContactDao(contactDaoConfig, this);
        conversationDataDao = new ConversationDataDao(conversationDataDaoConfig, this);
        infiniteConnectDao = new InfiniteConnectDao(infiniteConnectDaoConfig, this);
        messageDao = new MessageDao(messageDaoConfig, this);
        notifyDao = new NotifyDao(notifyDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Contact.class, contactDao);
        registerDao(ConversationData.class, conversationDataDao);
        registerDao(InfiniteConnect.class, infiniteConnectDao);
        registerDao(Message.class, messageDao);
        registerDao(Notify.class, notifyDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        contactDaoConfig.clearIdentityScope();
        conversationDataDaoConfig.clearIdentityScope();
        infiniteConnectDaoConfig.clearIdentityScope();
        messageDaoConfig.clearIdentityScope();
        notifyDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public ContactDao getContactDao() {
        return contactDao;
    }

    public ConversationDataDao getConversationDataDao() {
        return conversationDataDao;
    }

    public InfiniteConnectDao getInfiniteConnectDao() {
        return infiniteConnectDao;
    }

    public MessageDao getMessageDao() {
        return messageDao;
    }

    public NotifyDao getNotifyDao() {
        return notifyDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
